<ul class="nav nav-tabs">
  <li class="active"><a href="#model_{$entity->id}" data-toggle="tab">Model</a></li>
  <li><a href="#view_{$entity->id}" data-toggle="tab">View</a></li>
  <li><a href="#controller_{$entity->id}" data-toggle="tab">Controller</a></li>
</ul>

<div class="tab-content">
  <!-- model -->
  <div class="tab-pane active" id="model_{$entity->id}">
    <ul class="entity-items">
      {foreach from=$entity->attribute->order_by('name')->get() item="attribute" name=list_attributes}
        <li><a data-toggle="modal" data-target="#entities_edit" href="entities/edit/{$entity->id}/attributes/">{$attribute->name}</a></li>
      {/foreach}
    </ul>

    {if $entity->description}
    <p class="alert">{$entity->description}</p>
    {/if}
  </div>
  <!-- model -->
  
  <!-- view -->
  <div class="tab-pane" id="view_{$entity->id}">
    <ul class="entity-items">
    {foreach from=$entity->getViews() item="view" name=list_views}
      <li>
        <a href="views/edit/{$entity->id}/{$view}/">{$view}</a>
      </li>
    {/foreach}
    </ul>
  </div>
  <!-- view -->

  <!-- controller -->
  <div class="tab-pane" id="controller_{$entity->id}">
    {$controller = $entity->getReflectedController()}
    {if is_array($controller)}
    <a href="actions/edit/{$entity->id}/error/">The controller has sintax errors. Please fix it</a>
    {else}
    <ul class="entity-items">
      {foreach from=$controller->getMethods() item="action" name=list_actions}
        {if ($controller->name === $action->class)}
        <li>
          <a href="actions/edit/{$entity->id}/{$action->getName()}/">{$action->getName()}</a>
        </li>
        {/if}
      {/foreach}
      </ul>
    {/if}
  </div>
  <!-- controller -->

</div>
<!-- tab-content -->
